package cn.edu.scau.cmi.linjinyong.mybatis.dao;

import java.util.List;

import cn.edu.scau.cmi.linjinyong.mybatis.domain.Student;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import cn.edu.scau.cmi.linjinyong.mybatis.domain.Teacher;

public interface TeacherDao {

	@Select("select * from teacher")
	List<Teacher> listTeachers();
	
	@Delete("delete from teacher where id = #{id}")
	boolean deleteTeacher(long id);
	
	@Update("update teacher set name = #{teacher.name}, college = #{college} where id = #{teacher.id}")
	boolean updateTeacher(Teacher teacher);
	
	@Insert("insert into teacher (name, college) values (#{name}, #{college})")
	boolean addTeacher(Teacher teacher);
}
